<?php include COMMON_PATH.'/index/header.html' ?>
<!--回放-->
<div class="home-bot-wrap main-content cl-live-wrap clearfix">
    <div class="left-box">
        <!--回放-->
        <h1><span>往期培训</span></h1>
        <hr>
        <ul class="live-list-wrap clearfix">
            <?php foreach($back['lists'] as $v):?>
            <li class="fl" data-llid="<?=$v['mid']?>" data-pw="<?=$v['password']?>" data-url="Meeting/password"  data-href="/Meeting/back?mid=<?=$v['mid']?>">
                <a href="javascript:void(0);">
                    <div class="pic-wrap">
                        <img src="<?=$v['avatar']?>" onerror = "iService.imgNoFind(this)">
                        <p class="bot-description">
                            <span class="fl">时长：<?=$v['play']?></span>
                            <span class="fr"><?=$v['play_time']?></span>
                        </p>
                        <div class="opacity-wrap">
                            <i class="icon-play"></i>
                        </div>
                    </div>

                </a>
                <div class="font-wrap">
                    <p><?=$v['name']?></p>
                    <p>
                        讲师：<?=$v['nickname']?>
                        <?php if($user['type']):?>
                        <i class="fr icon iconfont icon-binkaobei" data-llid="<?=$v['mid']?>"></i>
                        <?php endif;?>
                        <!--<span class="fr thumbs-num"><i class="am-icon-user"></i>&nbsp;<?=$v['viewing']?></span>-->
                    </p>
                </div>
            </li>
            <?php endforeach;?>
        </ul>
        <div data-page-total="<?=$back['count']?>" data-page-per="<?=PAGE_NUMBER?>"  id="live-page-wrap"></div>
    </div>
</div>
<?php include COMMON_PATH.'/index/footer.html' ?>
<script>
    navActive(2);
    $(function(){
        layui.use(['element','layer','form', 'laypage', 'laydate'], function(){
            var layer = layui.layer //获得layer模块
                ,laypage = layui.laypage //获得laypage模块
                ,laydate = layui.laydate //获得laydate模块
                ,form = layui.form //获得laydate模块
                ,element = layui.element;

            var $btn_del = $('.icon-binkaobei');
            $btn_del.on('click', function () {
                var el_li = $(this).parents('li');
                var llid = $(this).attr('data-llid');
                var layerDel = layer.open({
                    type: 1,
                    title: false,
                    resize: false,
                    shadeClose:false,
                    closeBtn:false,
                    content:'<div class="confirm-wrap" style="padding: 20px 30px">' +
                    '<p style="margin:4px 0 20px 0; text-align: center; ">确定删除此条回放？</p>' +
                    '<div style="display: inline-block">'+
                    '<span class="layui-btn layui-btn-normal btn-modify" style="margin-right: 10px;">确定</span>'+
                    '<span class="layui-btn layui-btn-primary" onclick="layer.closeAll();">取消</span>'+
                    '</div></div>',
                    success: function(layero, index){
                        $('.btn-modify').off('click').on('click',function(){
                            var param = {
                                url:'Meeting/del',
                                data:{
                                    mid:llid
                                }
                            };
                            function successFun(data){
                                if(data.code==200){
                                    el_li.remove();
                                    layer.closeAll();
                                }else {
                                    layer.msg(data.data.message, {icon: 2,anim: 6,time:2*1000});
                                    layer.close(layerDel);
                                }
                            }
                            $.JsonRpc(param,successFun);
                        });
                    }
                });
            });
        });
    })
</script>
</html>